import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/starter'

Vue.use(VueRouter)

const routes = [

  { path: '/index', component: Index }
  // {
  //   path: '/user',
  //   name: 'User',
  //   component: User,
  //   children: [
  //     { path: 'add', component: add},
  //     {path: 'login',component: login}
  //   ]
  // },
]

const router = new VueRouter({
  routes
})

const VueRouterPush = VueRouter.prototype.push

VueRouter.prototype.push = function push (to) {
  return VueRouterPush.call(this, to).catch(err => err)
}
export default router
